package top.mhtools.pigeon.common.service.support;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.mhtools.pigeon.common.enums.SendTypeEnum;
import top.mhtools.pigeon.common.persistence.SendMessageRequest;
import top.mhtools.pigeon.ding.service.SendMessageDingTaltService;

/**
 * 钉钉发送分解器
 *
 * @author machen
 * @date 2020/4/24 22:22
 */
@Component
public class DingSendMessageSolver extends AbstractSendMessageExecuteStrategy {

    @Autowired
    private SendMessageDingTaltService sendMessageDingTaltService;

    @Override
    public void sendMessage(SendMessageRequest messageRequest) {
        sendMessageDingTaltService.sendMessage(messageRequest.getDingMessageReqDTO());
    }

    @Override
    public String supports() {
        return SendTypeEnum.DING_TALK.getName();
    }
}
